Generally, multiple packets (Packet) forwarded in a network belong to one or more service flow types. For example, service flows of different types need to be processed by using different service function (SF) nodes.
In the prior art, a procedure of processing a service packet is generally: when a network receives a packet sent by a user, a classifier determines, according to a preset classification rule, a service flow type to which the packet belongs, and then selects a proper service chain according to the determined service flow type, to process the packet. FIG. 1 is used as an example. FIG. 1 is a schematic diagram of a network for service packet forwarding. The network shown in FIG. 1 includes a routing device 1, an SF 1, an SF 2, an SF 3, a routing device 2, an SF 4, and an SF 5, where the SF 1, the SF 2, and the SF 3 are connected to the routing device 1, and the SF 4 and the SF 5 are connected to the routing device 2. When a packet reaches a classifier, the classifier determines a service flow type to which the packet belongs. It is assumed that a service flow of this type needs to be processed by using the SF 1 and the SF 4 successively, the classifier determines that a path that the service packet passes through is: the classifier→the routing device 1→the SF 1→the routing device 1→the routing device 2→the SF 4→the routing device 2. The classifier adds a service chain header to the packet, to obtain a modified packet. The service chain header includes a determined-service-chain identifier (ID). The classifier forwards the modified packet, so that the modified packet passes through all nodes on the service chain successively, and processing of the modified packet is completed. To forward the modified packet on a service chain, the routing device 1 and the routing device 2 need to know not only a correspondence between an ID of an SF and a service chain ID, but also an ID of a next-hop SF on the service chain and network address information of a routing device connected to the next-hop SF. That is, each routing device needs to create a forwarding entry. The forwarding entry includes a correspondence between the service chain ID, the ID of the SF, and network address information of a routing device connected to the SF. The forwarding entry is centrally configured and delivered by a controller.
A main function of the controller in the network is monitoring a relationship between each SF and the service chain, but not concerning related information of a routing device. However, to configure a forwarding entry for the routing device, the controller needs to additionally obtain network address information of the routing device. Consequently, the controller needs to additionally consume a network resource when configuring the forwarding entry for the routing device, and extra data processing load is brought to the controller.